package com.ruicar.afs.cloud.basic.common.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author infinity
 * @version 1.0
 * @date 2020/9/24 22:14
 */
@Data
@TableName(value ="basic_sms", autoResultMap = true)
public class BasicSms {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("唯一标识")
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    @JSONField(
            serializeUsing = com.alibaba.fastjson.serializer.ToStringSerializer.class
    )
    @TableId(
            value = "id",
            type = IdType.ASSIGN_ID
    )
    private Long id;

    @ApiModelProperty("0001 发短信 0002 发邮件")
    @JSONField(name = "code")
    private  String code;

    @ApiModelProperty("消息来源自那个系统")
    @JSONField(name = "uid")
    private  String uid;
 ;
    @ApiModelProperty("消息渠道;消息渠道：”0”-验证码；”1”-通知消息；”2”-营销消息；”3”-催收消息")
    @JSONField(name = "channel")
    private String channel ;

    @ApiModelProperty("手机号")
    private String phone ;

    @ApiModelProperty("模板id")
    private String templateId ;

    @ApiModelProperty("过期时间;过期时间，yyyy-MM-dd HH:mm:ss")
    private String estimatedTime ;

    @ApiModelProperty("短信内容")
    private String smsContent ;

    @ApiModelProperty("优先级;优先级1、2、3用于普通短信，5用于验证码")
    private String priority ;

    @ApiModelProperty("消息来源所属分类 ")
    private String origin ;

    @ApiModelProperty("部门ID")
    private String deptId ;

    @ApiModelProperty("合同号")
    private String contractNo ;

    @ApiModelProperty("创建者")
    @TableField(
            fill = FieldFill.INSERT
    )
    private String createBy;
    @JsonFormat(
            timezone = "GMT+8",
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @ApiModelProperty("创建时间")
    @TableField(
            fill = FieldFill.INSERT
    )
    @JSONField(
            format = "yyyy-MM-dd HH:mm:ss"
    )
    private Date createTime;
    @ApiModelProperty("更新者")
    @TableField(
            fill = FieldFill.UPDATE
    )
    private String updateBy;
    @JsonFormat(
            timezone = "GMT+8",
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @ApiModelProperty("更新时间")
    @TableField(
            fill = FieldFill.UPDATE
    )
    @JSONField(
            format = "yyyy-MM-dd HH:mm:ss"
    )
    private Date updateTime;
    @TableField(exist = false)
    private int  totalNum;
    @ApiModelProperty("模板类型")
    private String templateType;
    /** 模板业务场景 */
    @ApiModelProperty("模板业务场景")
    private String templateBusiness;
}
